﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MyLibellus
{
    public partial class GestioAuthor : Form
    {
        private Author a;

       
        private bool aceptar;

        public GestioAuthor()
        {
            InitializeComponent();
        }

        private void GestioAuthor_Load(object sender, EventArgs e)
        {
            if (a != null)
            {
                txtAuthor.Enabled = true;
                txtAuthor.Text = a.FullName;
                

            }
            else
            {
                a = new Author();
               
                txtAuthor.Text = "";
                txtAuthor.Enabled = true;
                txtAuthor.Focus();
            }

        }

        private void btnCancelarGestAuthor_Click(object sender, EventArgs e)
        {
            Close();
            this.aceptar = false;
            this.a = null;
        }

        public Author A
        {
            get { return a; }
            set { a = value; }
        }

        public bool Aceptar
        {
            get { return aceptar; }
            set { aceptar = value; }
        }

        private void btnAceptarGestAuthor_Click(object sender, EventArgs e)
        {
            this.Close();
            this.aceptar = true;
            a = new Author();
            a.FullName = txtAuthor.Text;
        }
    }
}
